<template>
  <div>
    <el-container>
        <el-header>莱州信息网后台管理系统</el-header>
        <el-row type="flex" class="row-bg">
          <el-col ><el-button class="tuichubtn" type="danger" @click="tuichu">退出登录</el-button></el-col>
        </el-row>
      <el-container>
        <el-aside width="200px">
          <el-col>
            <el-menu
              :default-active="acName"
              :unique-opened="true"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
              router
              
            >
              <el-menu-item index="1">
                <span slot="title">主页</span>
              </el-menu-item>
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-menu"></i>
                  <span>资源管理</span>
                </template>
                <el-menu-item-group>
                  <!-- <template slot="title">分组一</template> -->
                  <el-menu-item :index="item.name" v-for="(item,i) in navList" :key="i" >商家信息管理</el-menu-item>
                  <el-menu-item :index="item.name" v-for="(item,i) in navList2" :key="item.name">信息类型管理</el-menu-item>
                </el-menu-item-group> 
              </el-submenu>
             <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-menu"></i>
                  <span>用户管理</span>
                </template>
                <el-menu-item-group>
                  <!-- <template slot="title">分组一</template> -->
                  <el-menu-item :index="item.name" v-for="(item,index) in navList3" :key="item.index">用户信息管理</el-menu-item>
                  <el-menu-item index="3-2">选项2</el-menu-item>
                </el-menu-item-group>
                <!-- <el-menu-item-group title="分组2"> -->
                  <el-menu-item index="3-3">选项3</el-menu-item>
                </el-menu-item-group> 
              </el-submenu>

             <el-menu-item index="4" disabled>
                <i class="el-icon-document"></i>
                <span slot="title">导航三</span>
              </el-menu-item>
              <el-menu-item index="4">
                <i class="el-icon-setting"></i>
                <span slot="title">设置</span>
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
      <el-footer>莱州信息网后台管理系统</el-footer>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      acName:"aaa",

      navList:[
        {
          name:"/home/Msg"
        }
      ],
      navList2:[
        {
          name:"/home/Type"
        }
      ],
      navList3:[
        {
          name:"/home/UserMsg"
        }
      ]

    }
  },
   methods: {
      handleOpen(key, keyPath) {
        // console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        // console.log(key, keyPath);
      },
      //退出登录
    tuichu(){
      this.$router.push("/");
    }
    },
    created() {
      this.acName=this.$route.path
    },
    
  
};
</script>


<style scoped>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}



.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  
  
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
 .tuichubtn{
   position: absolute;
   top: -50px;
   right:23px;
 }
</style>
